/*#include<stdio.h>
int main() {
	int n = 0;
	scanf("%d", &n);
	int arr[20] = { 0 };
	int i = 0;
	while (n) {
		arr[i] = n % 6;
		n /= 6;
		i++;
	}
	for (int j = i - 1; j >= 0; j--) {
		printf("%d", arr[j]);
	}
	return 0;
}*/
#include<stdio.h>
void chan(int n, int m) {
	if (n > m - 1) {
		chan(n / m, m);
	}
	printf("%d", n % m);
}

int main() {
	int n = 0;
	int m = 0;
	printf("请输入要转换的数和进制:\n");
	scanf("%d %d", &n, &m);
	chan(n, m);
	return 0;
}
